<template>
	<view class="mask" @click.stop="onClose" v-if="show">
		<view class="overlay-wrap">
			<view class="container-menu">
				<view class="menu-content">
					<view class="menu-item" @click.stop="onQrDecoder">
						<image src="@/static/image/download/qrcode.png" class="menu-item__icon"></image>
						<text class="menu-item__text">{{Identify}}</text>
						<view class="iconfont icon-jiantou-you menu-item__arrow-right">
						</view>
					</view>
				</view>
				<view class="cancle-btn">
					{{cancel}}
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import vueMain from "@/main.js";
	export default {
		props: {
			show: {
				type: Boolean,
				default: () => false
			}
		},
		computed: {
			cancel() {
				return vueMain.$t('cancel')
			},
			Identify() {
				return vueMain.$t('other.Identify-the-QR-code')
			}
		},
		methods: {
			onClose() {
				this.$emit('update:show', false)
			},
			onQrDecoder() {
				this.$emit('onQrDecoder')
			}
		},

	}
</script>

<style lang="scss" scoped>
	@keyframes bottomUp {
		0% {
			transform: translateY(100%);
		}

		100% {
			transform: translateY(0%);
		}
	}

	@keyframes transparency {
		0% {
			background-color: rgba(0, 0, 0, 0);
		}

		100% {
			background-color: rgba(0, 0, 0, 0.8);
		}
	}



	.mask {
		z-index: 10080;
		transition-duration: 300ms;
		transition-timing-function: ease-out;
		position: fixed;
		inset: 0px;
		transition-property: opacity;
		display: flex;
		flex-direction: column;
		flex-shrink: 0;
		flex-grow: 0;
		flex-basis: auto;
		align-items: stretch;
		animation-name: transparency;
		animation-duration: 0.3s;

		.overlay-wrap {
			display: flex;
			justify-content: center;
			align-items: flex-end;
			flex: 1;
		}
	}

	.container-menu {
		width: 100%;
		padding: 0 30rpx;
		box-sizing: border-box;
		margin-bottom: 32rpx;
		animation-name: bottomUp;
		animation-duration: 0.3s;

		.menu-content {
			.menu-item {
				display: flex;
				align-items: center;
				background: #FFFFFF;
				border-radius: 20rpx;
				margin-bottom: 20rpx;
				padding: 34rpx 20rpx;

				&__icon {
					width: 48rpx;
					height: 48rpx;
					vertical-align: middle;
					margin-right: 20rpx;
				}

				&__text {
					font-size: 28rpx;
					font-family: HarmonyOS Sans-Regular, HarmonyOS Sans;
					font-weight: 400;
					color: #606665;
					line-height: 40rpx;
				}

				&__arrow-right {
					font-size: 24rpx;
					color: #606665;
					margin-left: auto;
				}
			}
		}

		.cancle-btn {
			box-sizing: border-box;
			padding: 30rpx 0;
			text-align: center;
			background: #FFFFFF;
			border-radius: 20rpx;
			font-size: 32rpx;
			font-family: HarmonyOS Sans-Regular, HarmonyOS Sans;
			font-weight: 400;
			color: #61BDB2;
		}
	}
</style>